import api.AsyncService;
import api.DemoService;
import com.demo.consumer.DubboConsumerApplication;
import org.apache.dubbo.config.annotation.Reference;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * @ClassName: AppResourcesTestCase
 * @Description: TODO(单元测试类)
 * @author lixin
 * @date 2019年7月17日 上午11:42:41
 * @version V1.0
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = DubboConsumerApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@EnableAutoConfiguration
@ActiveProfiles("dev")
public class ConsumerTestCase {
	
	@Reference
	private DemoService demoService;

    @Reference
    private AsyncService asyncService;

	/**
	 * @throws InterruptedException
	 */
	@Test
	public void getCustomerCase() throws InterruptedException {
		String msg = demoService.sayHello("张三");
	 	System.out.println("msg:"+msg);
	 	Thread.sleep(3000);
	}
}
